Skip to content

Document PHP feature flag telemetry#37093

Open
leoromanovsky wants to merge 1 commit into
leo.romanovsky/php-feature-flag-docsfrom
leo.romanovsky/php-feature-flag-telemetry-docs
Open

Document PHP feature flag telemetry#37093
leoromanovsky wants to merge 1 commit into
leo.romanovsky/php-feature-flag-docsfrom
leo.romanovsky/php-feature-flag-telemetry-docs

Conversation

@leoromanovsky
Copy link
Copy Markdown
Contributor

@leoromanovsky leoromanovsky commented May 28, 2026

Motivation

The base PHP Feature Flags docs add setup and evaluation flows. Exposures and flag evaluation metrics are not ready to publish yet because the PHP telemetry path is currently blocked by a Rust version mismatch. This stacked PR queues the documentation now so it can land when that blocker is resolved, while still giving PHP customers the same guidance as the other server SDK docs for confirming flag evaluation counts and experiment exposures.

Changes

This PR extends the PHP server SDK page with DD_METRICS_OTEL_ENABLED=true, notes that non-flat context attributes affect targeting and exposure reporting, and adds troubleshooting entries for feature_flag.evaluations and experiment exposures. It keeps the minimum PHP tracer prerequisite from the base docs as datadog/dd-trace 1.20.0 or later and uses the same terminology as the shared server SDK docs.

Decisions

This is stacked on #37089 so the first PR can land the core PHP setup separately from telemetry docs. The troubleshooting language follows the Java server SDK structure: flag evaluation metrics are described separately from experiment exposures, and exposures are scoped to flags associated with an experiment rather than presented as standard flag behavior.

Validation

  • Ran git diff --check.
  • Verified the PHP page contains DD_METRICS_OTEL_ENABLED, feature_flag.evaluations, and experiment exposure troubleshooting in the stacked diff.

@github-actions
Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@leoromanovsky leoromanovsky marked this pull request as ready for review June 2, 2026 20:37
@leoromanovsky leoromanovsky requested a review from a team as a code owner June 2, 2026 20:37
@rtrieu
Copy link
Copy Markdown
Contributor

rtrieu commented Jun 2, 2026

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated review by Claude. AI-generated; verify before acting.

Two small clarity/consistency points on the new metrics + troubleshooting additions. No blockers.

Reviewed 4a81902d51d3f359792b80704f64e38c6f8e7fb2workflow run

@rtrieu rtrieu self-requested a review June 2, 2026 20:58
@DataDog DataDog deleted a comment from github-actions Bot Jun 3, 2026
@DataDog DataDog deleted a comment from github-actions Bot Jun 3, 2026
@DataDog DataDog deleted a comment from github-actions Bot Jun 3, 2026
Copy link
Copy Markdown
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @leoromanovsky thanks for your PR. i left a few suggestions for specificity.

{{< /code-block >}}

<div class="alert alert-warning">Evaluation context attributes must be flat primitive values: strings, numbers, and booleans. Nested arrays, objects, and null values are ignored.</div>
<div class="alert alert-warning">Evaluation context attributes must be flat primitive values: strings, numbers, and booleans. Nested arrays, objects, and null values are ignored for targeting and exposure reporting.</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div class="alert alert-warning">Evaluation context attributes must be flat primitive values: strings, numbers, and booleans. Nested arrays, objects, and null values are ignored for targeting and exposure reporting.</div>
<div class="alert alert-warning">Evaluation context attributes must be flat primitive values: strings, numbers, and Booleans. Nested arrays, objects, and null values are ignored for targeting and exposure reporting.</div>


#### Flag evaluation metrics

Flag evaluation counts appear in Datadog when `DD_METRICS_OTEL_ENABLED=true` is set for the PHP tracer. Each evaluation emits a `feature_flag.evaluations` counter metric tagged with the flag key, result variant, and evaluation reason. If this metric does not appear, verify the setting is enabled and the Datadog PHP SDK version supports it.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Flag evaluation counts appear in Datadog when `DD_METRICS_OTEL_ENABLED=true` is set for the PHP tracer. Each evaluation emits a `feature_flag.evaluations` counter metric tagged with the flag key, result variant, and evaluation reason. If this metric does not appear, verify the setting is enabled and the Datadog PHP SDK version supports it.
Flag evaluation counts appear in Datadog when `DD_METRICS_OTEL_ENABLED=true` is set for the PHP tracer. Each evaluation emits a `feature_flag.evaluations` counter metric tagged with the flag key, result variant, and evaluation reason. If this metric does not appear, confirm `DD_METRICS_OTEL_ENABLED=true` is set in your environment and that your PHP tracer version supports flag evaluation metrics.

export DD_ENV=<YOUR_ENVIRONMENT>
export DD_VERSION=<YOUR_APP_VERSION>

# Required: Enable flag evaluation metrics
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Required: Enable flag evaluation metrics
# Required for flag evaluation metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants